package com.ry.es.query;

import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.TermQueryBuilder;

/**
 * Created by walker on 17-11-22.
 *
 */
public class MatchQuery extends EsQuery
{
    private String field;
    private String value;

    public MatchQuery(String field, String value){
        this.field = field;
        this.value = value;
    }

    public String getValue()
    {
        return value;
    }

    public void setValue(String value)
    {
        this.value = value;
    }

    public String getField()
    {

        return field;
    }

    public void setField(String field)
    {
        this.field = field;
    }

    public QueryBuilder toQuery()
    {
        return new MatchQueryBuilder(field, value);
    }
}
